package wsepForum.ui.swing.innerPanels;

import java.awt.Color;
import java.awt.Font;
import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.MatteBorder;

import wsepForum.ui.swing.outerPanels.AOuterPanel;

public abstract class AManageSectionPanel extends AInnerPanel {
	
	private static final long serialVersionUID = 1L;
	
	protected Vector<String> usernameList;
	
	protected JTextField sectionNameTextField;
	
	protected JButton btnSubmit;

	protected JList allUsersList;
	
	/**
	 * @wbp.parser.constructor
	 */
	public AManageSectionPanel(AOuterPanel oPanel, Vector<String> userList) {
		super(oPanel);
		this.usernameList = userList;
	}
	
	protected void initPanel(){
		setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
		setLayout(null);
		setBackground(new Color(230, 230, 250));
		setBounds(20, 93, 716, 364);

		JLabel lblMessageEditor = new JLabel("Manage Sections");
		lblMessageEditor.setHorizontalAlignment(SwingConstants.CENTER);
		lblMessageEditor.setFont(new Font("Cooper Black", Font.PLAIN, 18));
		lblMessageEditor.setBounds(240, 11, 235, 31);
		add(lblMessageEditor);
		
		this.sectionNameTextField = new JTextField();
		this.sectionNameTextField.setBounds(300, 65, 116, 20);
		add(this.sectionNameTextField);
		this.sectionNameTextField.setColumns(10);
		
		JLabel lblSectionName = new JLabel("Section Name:");
		lblSectionName.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblSectionName.setBounds(206, 68, 91, 14);
		add(lblSectionName);
		
		
		JLabel lblSelectModeratorsFor = new JLabel("Select moderators:");
		lblSelectModeratorsFor.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblSelectModeratorsFor.setBounds(206, 100, 210, 14);
		add(lblSelectModeratorsFor);
		
		JScrollPane allUsersScroll = new JScrollPane();
		allUsersScroll.setBounds(220, 125, 116, 189);
		add(allUsersScroll);
			
		this.allUsersList = new JList();
		allUsersScroll.setViewportView(allUsersList);
		this.setDitails();
		
		this.btnSubmit = new JButton("Submit");
		this.btnSubmit.setFont(new Font("Tahoma", Font.PLAIN, 10));
		this.btnSubmit.setBounds(349, 330, 67, 23);
		add(this.btnSubmit);
		this.addSubmitFunctionality();
	}
	
	protected abstract void setDitails();
	protected abstract void addSubmitFunctionality();
}
